// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 单个删除用户信息 DELETE /user/deleteById/${param0} */
export async function deleteUserByIdUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUserByIdUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Robject>(`/user/deleteById/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询当前用户信息 GET /user/getUserInfo */
export async function getUserInfoUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/user/getUserInfo', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 新增用户信息 POST /user/save */
export async function saveUserUsingPost(body: API.UserAddDTO, options?: { [key: string]: any }) {
  return request<API.Robject>('/user/save', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 单个查询用户信息 GET /user/selectById/${param0} */
export async function selectUserByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.selectUserByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Robject>(`/user/selectById/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取班级ID和Name集合 GET /user/selectIdAndName */
export async function selectClassIdAndNameUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/user/selectIdAndName', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 分页查询用户信息 GET /user/selectPage */
export async function selectUserPageUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.selectUserPageUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.Robject>('/user/selectPage', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 修改当前用户信息 PUT /user/updateById */
export async function updateUserByIdUsingPut(
  body: API.UserEditDTO,
  options?: { [key: string]: any },
) {
  return request<API.Robject>('/user/updateById', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
